# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-webrtcvad
pkgver=2.0.10
pkgrel=0
pkgdesc="Python interface to the Google WebRTC Voice Activity Detector (VAD)"
url="https://github.com/wiseman/py-webrtcvad"
# 32-bit arches are not supported
# s390x, ppc64le and riscv64 are not supported
arch="all !x86 !armhf !armv7 !s390x !ppc64le !riscv64"
license="MIT AND BSD-3-Clause"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="
	py3-memory-profiler
	pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/wiseman/py-webrtcvad/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/py-webrtcvad-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ce414e39c3128e22495e8e21e46d09485952168ca763937cebb654dab87ffcfecea8198c74c009a47d8caed2a8ebc22572036fda4be36597d82e6e7057f80ae2  py3-webrtcvad-2.0.10.tar.gz
"
